package com.zzyl.mapper;

import com.zzyl.dto.NursingPlanPageQueryDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {
    /**
     * 分页查询护理计划
     * @param dto
     * @return
     */
    List<NursingPlanVo> pageQuery(NursingPlanPageQueryDto dto);


    void add(NursingPlan nursingPlan);

    /**
     * 根据Id查询
     * @param id
     * @return
     */
    NursingPlanVo getById(Long id);

    void update(NursingPlan nursingPlan);
    /**
     * 删除护理计划
     * @param id
     * @return
     */
    @Delete("delete from nursing_plan where id = #{id}")
    void delete(Long id);

    @Select("select id,plan_name,status,create_time,update_by,create_by,update_time from nursing_plan where status = 1")
    List<NursingPlanVo> getAllNP();
}

